load("@io_bazel_rules_go//go:def.bzl", "go_library")

# keep
go_library(
    name = "gssapiccl",
    srcs = select({
        "@io_bazel_rules_go//go/platform:linux": [
            "get_user.go",
            "gssapi.go",
        ],
        "//conditions:default": ["empty.go"],
    }),
    cdeps = select({
        "@io_bazel_rules_go//go/platform:linux": ["//c-deps:libkrb5"],
        "//conditions:default": [],
    }),
    cgo = True,
    clinkopts = select({
        # NB: On Ubuntu, res_nsearch is found in the resolv_wrapper library,
        # found in the libresolv-wrapper package.
        "//build/toolchains:is_dev_linux": ["-ldl -lresolv -lresolv_wrapper"],
        "@io_bazel_rules_go//go/platform:linux": ["-ldl -lresolv"],
        "//conditions:default": [],
    }),
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/gssapiccl",
    visibility = ["//visibility:public"],
    deps = select({
        "@io_bazel_rules_go//go/platform:linux": [
            "//pkg/ccl/utilccl",
            "//pkg/security/username",
            "//pkg/settings",
            "//pkg/sql",
            "//pkg/sql/pgwire",
            "//pkg/sql/pgwire/hba",
            "//pkg/sql/pgwire/identmap",
            "//pkg/sql/sem/tree",
            "@com_github_cockroachdb_errors//:errors",
            "@com_github_go_ldap_ldap_v3//:ldap",
        ],
        "//conditions:default": [],
    }),
)
